package com.ruoyi.order.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.ruoyi.order.domain.OrderPayment;
import com.ruoyi.order.mapper.OrderPaymentMapper;
import com.ruoyi.order.service.IOrderPaymentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 订单支付信息Service业务层处理
 *
 * @author HHAOYU
 * @date 2020-12-14
 */
@Service
public class OrderPaymentServiceImpl extends ServiceImpl<OrderPaymentMapper, OrderPayment> implements IOrderPaymentService {
    @Autowired
    private OrderPaymentMapper orderPaymentMapper;

    /**
     * 查询订单支付信息
     *
     * @param id 订单支付信息ID
     * @return 订单支付信息
     */
    @Override
    public OrderPayment selectOrderPaymentById(Long id)
    {
        return orderPaymentMapper.selectOrderPaymentById(id);
    }

    /**
     * 查询订单支付信息列表
     *
     * @param orderPayment 订单支付信息
     * @return 订单支付信息
     */
    @Override
    public List<OrderPayment> selectOrderPaymentList(OrderPayment orderPayment)
    {
        return orderPaymentMapper.selectOrderPaymentList(orderPayment);
    }

    @Override
    public List<OrderPayment> selectByPayCode(String payCode){
        return orderPaymentMapper.selectByPayCode(payCode);
    }
    /**
     * 新增订单支付信息
     *
     * @param orderPayment 订单支付信息
     * @return 结果
     */
    @Override
    public int insertOrderPayment(OrderPayment orderPayment)
    {
        return orderPaymentMapper.insertOrderPayment(orderPayment);
    }

    /**
     * 修改订单支付信息
     *
     * @param orderPayment 订单支付信息
     * @return 结果
     */
    @Override
    public int updateOrderPayment(OrderPayment orderPayment)
    {
        return orderPaymentMapper.updateOrderPayment(orderPayment);
    }

    /**
     * 批量删除订单支付信息
     *
     * @param ids 需要删除的订单支付信息ID
     * @return 结果
     */
    @Override
    public int deleteOrderPaymentByIds(Long[] ids)
    {
        return orderPaymentMapper.deleteOrderPaymentByIds(ids);
    }

    /**
     * 删除订单支付信息信息
     *
     * @param id 订单支付信息ID
     * @return 结果
     */
    @Override
    public int deleteOrderPaymentById(Long id)
    {
        return orderPaymentMapper.deleteOrderPaymentById(id);
    }
}
